<?php

namespace src;

use ReflectionClass;

class ImageHosting {

	private $uploadNames = ['Alibaba','Baidu','Netease','Suning','Toutiao'];

	public function upload($path,$uploadName){ 

		if(!in_array($uploadName,$this->uploadNames)) return false; 

		$className = 'src\lib\\'.$uploadName;
		$upload = new ReflectionClass($className);
		$instance = $upload -> newInstance();
		
		$res = $instance -> upload($path);

		return $res;
	}
}